<cfparam default="none" name="url.api" />

<!---Need to call BASE functions--->
<cfset BASE = CreateObject("component", "cfc.base") />
<cfset baseQueries = CreateObject("component", "cfc.queries") />
<cfset step1Queries = CreateObject("component", "cfc.step1Queries") />
<cfset utils = CreateObject("component", "cfc.utilities") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">
<cfoutput>

<!--- API INSERTS step1 hire.  Function: funcStep1InsertEmployee --->
<cfif url.api eq "insert_step1_employee" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
        	<cfset step1Employee = step1Queries.funcStep1InsertEmployee(FORM) />
            
            <!---Scott's old code--->
            <cfset Session.EmpConfirm = "The process to hire " & FORM.First>
            <cfif FORM.Preferred NEQ "">
                <cfset Session.EmpConfirm = Session.EmpConfirm & " (" & 
                    FORM.Preferred & ")">
            </cfif>
            <cfif FORM.MI NEQ "">
                <cfset Session.EmpConfirm = Session.EmpConfirm & " " & FORM.MI>
            </cfif>
            <cfset Session.EmpConfirm = Session.EmpConfirm & " " & FORM.Last & " has been successfully submitted to HR.  Please wait for confirmation
            of offer acceptance and estimated start date.  Thank you for using E-PAR. <p>Hire another employee? Click <a href='Step1-Hire.cfm'>Here</a>">
            <!---Scott's old code--->
            
            <cflocation url="Step1-Confirmation.cfm" addtoken="no" />
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API INSERTS step1 hire.  Function: funcStep1InsertEmployee --->





<!--- API Updates and Inserts step2 pre orientation.  Function: funcUpdateStep2Employee --->
<cfif url.api eq "update_step2_employee" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset step2Queries = CreateObject("component", "cfc.step2Queries") />
            
        	<!---TODO:  Fix this amateur programmer thingy--->
        	<cfif isDefined('URL.Decline')  >
        		<cfset FORM.Decline = 1/>
                <cfset Session.OfferAccepted = False />
            <cfelse>
            	<cfset Session.OfferAccepted = True />
            </cfif>
            
        	<cfset step2Employee = step2Queries.funcUpdateStep2Employee(FORM) />
            
            <cfset Supervisor = SCF_Employee_GetEmployeeInfo_Basic(step2Employee.FORM.SupervisorID) />
            <cfset Session.SupEmail = Supervisor.Email>  
            
            <cfif trim(step2Employee.FORM.Preferred) NEQ "">
                <cfset LOCAL.Name = step2Employee.FORM.First & ' (' & trim(step2Employee.FORM.Preferred) & ')'>
            <cfelse>
                <cfset LOCAL.Name = step2Employee.FORM.First>
            </cfif>
            
            <cfif trim(FORM.MI) NEQ "">
                <cfset LOCAL.Name = step2Employee.FORM.First & ' ' & trim(step2Employee.FORM.MI)>
            </cfif>
            
            <cfset LOCAL.Name = LOCAL.Name & ' ' & step2Employee.FORM.Last>
            
            <cfset Session.Step2Confirm = "
				<p>Employee to Hire: #LOCAL.Name#<br>
				Est Start Date: #step2Employee.FORM.EstStartDate# <br>
				Exempt: #BASE.YesNo(isDefined('step2Employee.FORM.Exempt'))#<br>
				Full Time: #BASE.YesNo(isDefined('step2Employee.FORM.FullTime'))#<br>
				Seasonal: #BASE.YesNo(isDefined('step2Employee.FORM.Seasonal'))#<br>
				Primary Position: #BASE.YesNo(isDefined('step2Employee.FORM.Primary'))#<br>
				Position Code: #step2Employee.QUERIES.GetPositionInfo.PositionCode#<br>
				Position Title: #step2Employee.QUERIES.GetPositionInfo.PositionCodeDescription#  <br>
				Department: #step2Employee.QUERIES.GetDepts.Org#<br>
				Supervisor: #Supervisor.FirstName# #Supervisor.LastName#   <br><br>
				Cost Code: #step2Employee.FORM.CostCode#   <br>
				Leave Eligible: #BASE.YesNo(isDefined('step2Employee.FORM.Leave'))#   <br>
				Benefits Eligible: #BASE.YesNo(isDefined('step2Employee.FORM.Benefits'))#   <br>
				Salary/Hourly: #step2Employee.QUERIES.GetSalaryHourly.PersonCode#<br>
				Hours Per Week: #step2Employee.FORM.HoursPerWeek#<br>
				Pay Rate: $#step2Employee.FORM.PayRate#<br>
				Frequency: #step2Employee.QUERIES.GetFrequency.PayRateFrequencyCode# <br>
				Annual Rate: $#step2Employee.FORM.PayRate * step2Employee.QUERIES.GetFrequency.AnnualizingFactor#<br/>
				Comments: #step2Employee.FORM.Notes#</p>"
            / >
            
            <cflocation url="Step2-Confirmation.cfm" addtoken="no" />
            
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API API Updates and Inserts step1 hire.  Function: funcUpdateStep2Employee --->







<!--- API handles step3 orientation  --->
<cfif url.api eq "step3_orientation" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="GET" >
        	<cfparam default="-1" name="URL.StepID" />
            
            <cflocation url="Step3-Orientation2.cfm?StepID=#URL.StepID#" addtoken="no" />
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API handles step3 orientation  --->







<!--- API handles step3 orientation no show --->
<cfif url.api eq "step3_no_show" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
        	<cfparam default="-1" name="URL.StepID" />
            
            <cfset step3UpdateActionNoShow = baseQueries.funcUpdateAction(URL.StepID, Session.intUserRosettaID, 'Orientation No Show') />
            
            <cflocation url="Step3-Confirmation.cfm?StepID=#URL.StepID#" addtoken="no" />
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API handles step3 orientation no show --->







<!--- API UPDATES step3 orientation Function: funcUpdateStep2Employee --->
<cfif url.api eq "update_step3_employee" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset step3Queries = CreateObject("component", "cfc.step3Queries") />
            
            <!--- TODO: Fix this amateur programmer thingy --->
            <cfif isDefined('URL.NoShow')  >
                <cfset FORM.Decline = 1/>
                <cfset Session.OfferAccepted = False />
            <cfelse>
                <cfset Session.OfferAccepted = True />
            </cfif>
            
            <cfset Session.FormComments = FORM.Notes />
            
            <cfset step3Employee = step3Queries.funcUpdateStep3Employee(FORM) />
            
            <cfset Session.EmpID = step3Employee.FORM.EmpID />
            
            <cfset Cleared = BASE.EPLSCheck('#step3Employee.FORM.First#', '#step3Employee.FORM.Last#', '#step3Employee.FORM.SSN#', #step3Employee.FORM.EmpID#) />
            
            <cfif Cleared>
                
                <cfif Session.OfferAccepted EQ True >
                    <cflocation url="Step3-Orientation3.cfm?StepID=#step3Employee.FORM.StepID#" addtoken="no">
                <cfelse>
                    <cflocation url="Step3-Orientation1.cfm" addtoken="no">
                </cfif>
                 
            <cfelse>
            
                <cfset Step3CheckEPLS = baseQueries.funcInsertAction(step3Employee.FORM.EmpID, 16) />
                <cfset StepID = Step3CheckEPLS.NewStepID>
                <cfset Session.NotCleared = True>
                <cflocation url="Step3-OrientationEPLSFailed.cfm?StepID=#step3Employee.FORM.StepID#"> 
                  
            </cfif>
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API UPDATES step3 orientation Function: funcUpdateStep2Employee --->






<!--- API Inserts step3 Orientation - Beneficaries Function: funcStep3InsertBeneficaries --->
<cfif url.api eq "insert_step3_employee_beneficaries" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset step3Queries = CreateObject("component", "cfc.step3Queries") />
            
            <cfset step3Beneficaries = step3Queries.funcStep3InsertBeneficaries(FORM) />
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API Inserts step3 Orientation - Beneficaries Function: funcStep3InsertBeneficaries --->






<!--- API Inserts step3 Orientation - Emergency Contacts Function: funcStep3InsertEmergencyContacts --->
<cfif url.api eq "insert_step3_emergency_contacts" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset step3Queries = CreateObject("component", "cfc.step3Queries") />
            
            <cfset step3EmergencyContacts = step3Queries.funcStep3InsertEmergencyContacts(FORM) />
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API Inserts step3 Orientation - Emergency Contacts Function: funcStep3InsertEmergencyContacts --->







<!--- API that handles step3 completion Function: funcUpdateAction, funcInsertAction --->
<cfif url.api eq "step3_completion" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            <cfset step3Completion = baseQueries.funcUpdateAction(FORM.StepID, Session.intUserRosettaID) />
            <cfset step3Completion = baseQueries.funcInsertAction(FORM.EmpID, 4) />
            <cflocation url="Step3-SpawnCreation.cfm?StepID=#step3Completion.NewStepID#" addtoken="no" />
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles step3 completion Function: funcUpdateAction, funcInsertAction --->






<!--- API that handles step1 Termination Function: funcInsertAction --->
<cfif url.api eq "step1Termination_insert" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset termQuereis = CreateObject("component", "cfc.terminationQueries") />
            
            <cfset InsertTerminationRequest = termQuereis.funcInsertTermanationRequestAction(FORM) />
            <cfset baseQueries.funcInsertAction("", 18 , Session.intUserRosettaID, '#FORM.Comments#', "True", InsertTerminationRequest) />
            <cfset baseQueries.funcInsertAction("", 20 , "", "", "", InsertTerminationRequest) />
            
            <cfset Session.EmpConfirm = "The request for termination of the employee " & 
            SCF_Employee_GetEmployee(FORM.RosettaID).FullName & 
            " has been successfully submitted to HR.  Thank you for using E-PAR.
            <p>Initiate another request?  Click <a href=""Step1-Request.cfm"">Here</a>">
            
            <cflocation url="Termination/Step1-Confirmation.cfm" addtoken="no">
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles step1 Termination Function: funcInsertAction --->





<!--- API that handles step2 Termination Acknowledgement Function:  --->
<cfif url.api eq "step2Termination_acknowledgement" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset Session.TermReqID = Form.TermReqID>
            <cflocation url="Termination/Step2-HRAcknowledgeRequest2.cfm?TermReqID=#Session.TermReqID#" addtoken="no">
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles step2 Termination Acknowledgement Function:  --->





<!--- API that handles step2 Termination Database update Function:  --->
<cfif url.api eq "step2Termination_acknowledgement_update" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset termQuereis = CreateObject("component", "cfc.terminationQueries") />
            
            <cfset UpdateTerminationRequest = termQuereis.funcUpdateTermanationRequestAction(FORM) />
            
            <cflocation url="Termination/Step2-HRAcknowledgeRequest3.cfm" addtoken="no">
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles step2 Termination Database update Function:  --->





<!--- API that handles step2 Termination Acknoledge Request 3 uploading a file Function:  --->
<cfif url.api eq "step2Termination_acknowledgement_file_upload" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset termQuereis = CreateObject("component", "cfc.terminationQueries") />
                                       
	        <cffile action='upload' filefield='FileUpload' destination='#FORM.Directory#' nameconflict='makeunique' />        
	           
	        <cfset AddFile = termQuereis.funcInsertFile(-1, FORM.TermReqID, '#cffile.ServerFile#', Form.FileTypeID, Session.intUserRosettaID ) />
                                    
            <cflocation url="#CGI.HTTP_REFERER#" addtoken="no" />

        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles step2 Termination Database update Function:  --->





<!--- API that handles step2 Termination Acknoledge Request 3 finish Function:  --->
<cfif url.api eq "step2Termination_acknowledgement_finish" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
        
	        <cfset QUERIES.GetTermDetails = baseQueries.funcGetTermDetails( FORM.TermReqID, 20 ) />
	        
	        <cfset UpdateAction = baseQueries.funcUpdateAction( QUERIES.GetTermDetails.ActionStepID, Session.intUserRosettaID, FORM.Comments ) />
	        
	        <cfset InsertAction = baseQueries.funcInsertAction("", 22, "", "", "", FORM.TermReqID ) />
	         
	        <cflocation url="Termination/Step3-ExecTerm.cfm" addtoken="no"> 
        
        </cfcase>
    </cfswitch>
</cfif>
<!--- API that handles step2 Termination Acknoledge Request 3 finish Function:  --->





<!--- API that handles Step4 Badge Creation:  --->
<cfif url.api eq "step4_badge_creation" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset step4Queries = CreateObject("component", "cfc.step4Queries") />
            
	        <cfset LOCALS = {} />

	        <cfloop index="i" list="#FORM.FieldNames#" DELIMITERS=",">
	            
	            <cfif left(i,5) EQ "Badge">

	                <cfset LOCALS.BadgeNo = Form[i]>
	                <cfset LOCALS.EmpID = ListGetAt(i, 2, '_')>
	                <cfset LOCALS.StepID = ListGetAt(i, 3, '_')>
	                
	                <cfset QUERIES.GetEmpInfo = baseQueries.funcGetEmpInfo( LOCALS.StepID ) />
	
	                <cfif QUERIES.GetEmpInfo.recordcount GT 0>
	                 
	                    <!---Updage Badge Number --->
	                    <cfif isnumeric(LOCALS.BadgeNo) EQ 1>
	                       
	                        <cfset QUERIES.UpdateBadgeNo = step4Queries.funcUpdateBadgeNo(LOCALS.EmpID, LOCALS.BadgeNo ) />
	                        
	                        <cfset QUERIES.UpdateEmployee = step4Queries.funcUpdateEmployee(LOCALS.EmpID, LOCALS.BadgeNo ) />                        
	                        
	                        <cfset QUERIES.UpdateAction = baseQueries.funcUpdateAction( LOCALS.StepID, Session.intUserRosettaID, 'Batch Style Badge Creation - No Comments' ) />
	                        
	                        <cfset QUERIES.InsertAction = baseQueries.funcInsertAction( LOCALS.EmpID, 6 ) />
	                        
	                        <cfset QUERIES.GetAccessRequest = step4Queries.funcGetAccessRequest(LOCALS.EmpID) /> 
	                        
	                        <cfif QUERIES.GetAccessRequest.BadgeAccessLevelID NEQ "-- None --" AND 
                                QUERIES.GetAccessRequest.BadgeAccessLevelID NEQ 0 AND 
                                    QUERIES.GetAccessRequest.BadgeAccessLevelID NEQ ""> <!--- Add to the Facilities Queue only if necessary--->
	                            
	                            <cfset QUERIES.InsertAction = baseQueries.funcInsertAction( LOCALS.EmpID, 7 ) />
                                
	                            
	                        </cfif>
                                                                                                    
	                    </cfif>
                                                                                    
	                </cfif>
                                                                    
	            </cfif>
	            
	        </cfloop>
                                    
            <cflocation url="status.cfm" addtoken="no" />
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles Step4 Badge Creation:  --->




<!--- API that handles Step5 Finance Creation:  --->
<cfif url.api eq "step5_finance_creation" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset step5Queries = CreateObject("component", "cfc.step5Queries") />
            
            <cfset LOCALS = {} />
            
            <cfloop index="i" list="#FORM.FieldNames#" DELIMITERS=",">

                <cfif left(i,5) EQ "EmpNo">
                
	                <cfset LOCALS.Ext = right(i,len(i)-5)>
	                <cfset LOCALS.Fundware_EmpNo = Form[i]>
	                <cfset LOCALS.EmpID = ListGetAt(i, 2, '_')>
	                <cfset LOCALS.StepID = ListGetAt(i, 3, '_')>  
	                <cfset LOCALS.Comments = Form['Comments' & LOCALS.Ext]>
	                
                    <cfset QUERIES.GetEmpInfo = baseQueries.funcGetEmpInfo( LOCALS.StepID ) />
	                
	                <cfif QUERIES.GetEmpInfo.recordcount GT 0>
                                                                      
	                    <cfif isnumeric(LOCALS.Fundware_EmpNo) EQ 1>
      
	                        <!---Updage Rosetta Stone with Finance EmpNo --->
                            <cfset QUERIES.UpdateEmpNo = step5Queries.funcUpdateEmpNo(
                                LOCALS.EmpID, 
                                LOCALS.Fundware_EmpNo 
                            ) />	                        
	                    
	                        <!---Update Kronos HR with User Account & Finance EmpNo --->
	                        <cfif QUERIES.UpdateEmpNo.recordcount GT 0>
                                
                                <cfset QUERIES.UpdateKronosHR = baseQueries.funcUpdateKronosHR( 
                                    QUERIES.UpdateEmpNo.HRProd_PersonIDNo, 
                                    LOCALS.EmpID, 
                                    QUERIES.UpdateEmpNo.UserAccount 
                                ) />

	                        </cfif>	                        
	                        
	                        <!--- Advance the Step Action --->
                            <cfset QUERIES.UpdateAction = baseQueries.funcUpdateAction( 
                                LOCALS.StepID, 
                                Session.intUserRosettaID, 
                                LOCALS.Comments 
                            ) />
	                        
	                    </cfif>
                                                                                    
	                </cfif>
                                                                    
                </cfif>
               
            </cfloop>
            
            <cflocation url="status.cfm" addtoken="no" />
        
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles Step5 Finance Creation:  --->





<!--- API that handles Step5 Access Control:  --->
<cfif url.api eq "step5_access_control_update" >    
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <cfset step5Queries = CreateObject("component", "cfc.step5Queries") />
            
            <cfset LOCALS = {} />
            
            <cfloop index="i" list="#FORM.FieldNames#" DELIMITERS=",">
            
	            <cfif left(i,8) EQ "AccessID">
	                <cfset LOCALS.Ext = right(i,len(i)-8)>
	                <cfset LOCALS.AccID = Form[i]>
	                <cfset LOCALS.EmpID = ListGetAt(i, 2, '_')>
	                <cfset LOCALS.StepID = ListGetAt(i, 3, '_')>  
	                <cfset LOCALS.Comments = Form['Comments' & LOCALS.Ext]>
	
	                <cfset QUERIES.GetEmpInfo = baseQueries.funcGetEmpInfo( LOCALS.StepID ) />
	                  
	                <cfif QUERIES.GetEmpInfo.recordcount GT 0>         
	                    <!---Updage Rosetta Stone with Access Control ID --->
	                    <cfif isnumeric(LOCALS.AccID) EQ 1>
	                        
	                        <cfset QUERIES.UpdateAccessID = step5Queries.funcUpdateAccessID( 
	                            LOCALS.EmpID, LOCALS.AccID
	                        ) />
	                        
	                        <!--- Advance the Step Action --->
	                        <cfset QUERIES.UpdateAction = baseQueries.funcUpdateAction( 
	                            LOCALS.StepID, 
	                            Session.intUserRosettaID, 
	                            LOCALS.Comments 
	                        ) />
	
	                    </cfif>                   
	                    
	                </cfif>
	            </cfif>
            </cfloop>
        
            <cflocation url="status.cfm" addtoken="no" />
        
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles Step5 Access Control:  --->




<!--- API that handles SCF Step4 finance termination: --->
<cfif url.api eq "step4_finace_termination" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
        
            <cfloop index="i" list="#FORM.FieldNames#" DELIMITERS=",">
	            <cfif left(i,4) EQ "Term" And Form[i] EQ "on">
	                <cfset LOCALS.StepActionID = right(i, len(i)-4)>

                    <cfset QUERIES.UpdateAction = baseQueries.funcUpdateAction( 
	                    LOCALS.StepActionID, Session.intUserRosettaID, 
	                    'Completed by Finance' ) />
                    
	            </cfif>
            </cfloop>
            
            <cflocation url="termination/status.cfm" addtoken="no" />
        
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles SCF Step4 finance termination: --->




<!--- API that handles SCF Step4 finance termination: --->
<cfif url.api eq "step4_access_control_termination" >
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="POST" >
            
            <!--- Loop through all form elements and set check boxes to 1 if they are = "on" --->
	        <cfloop index="i" list="#FORM.FieldNames#" DELIMITERS=",">
	            <cfif left(i,4) EQ "Term" And Form[i] EQ "on">
	                <cfset LOCALS.StepActionID = right(i, len(i)-4) >
	                
                    <cfset QUERIES.UpdateAction = baseQueries.funcUpdateAction( 
                    LOCALS.StepActionID, Session.intUserRosettaID, 
                    'Completed by Facilites' ) />

	            </cfif>
	        </cfloop>
            
            <cflocation url="termination/status.cfm" addtoken="no" />
            
        </cfcase>    
    </cfswitch>
</cfif>
<!--- API that handles SCF Step4 finance termination: --->



<cfif url.api eq "get_position_details" >    
    <cfparam default="0" name="url.id" />
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="GET" >
            <cfscript>
            PositionDetails = baseQueries.funcGetPositionCode(url.id);
			retval = {
			    JobTitle = PositionDetails['JobCodeDescription'][1],
				HoursPerYear = PositionDetails['StandardUnitsPerYear'][1],
				SCF_UDF1 = PositionDetails['PositionCodeUserDefined1'][1],				
				SCF_UDF2 = PositionDetails['PositionCodeUserDefined2'][1],
				SCF_UDF3 = PositionDetails['PositionCodeUserDefined3'][1],
				WorkersCompCode = PositionDetails['PositionCodeUserDefined4'][1],
				PayGradeCode = PositionDetails['PayGradeCode'][1],
				PayGradeCodeDescription = PositionDetails['PayGradeCodeDescription'][1],
				JobCode = PositionDetails['JobCode'][1]
			};
			</cfscript>
            #SerializeJSON(retval)#
        </cfcase>    
    </cfswitch>
</cfif>

<cfif url.api eq "get_workers_details" >    
    <cfparam default="0" name="url.id" />
    <cfswitch expression="#CGI.REQUEST_METHOD#">
        <cfcase value="GET" >
            <cfscript>
                WorkersComp = utils.funcGetWorkersCompID(url.id);
            </cfscript>
            #SerializeJSON(WorkersComp)#
        </cfcase>    
    </cfswitch>
</cfif>


</cfoutput>